package com.crm.controller;


import com.crm.base.ResponseResult;
import com.crm.domain.dto.MenuDTO;
import com.crm.domain.entity.Menu;
import com.crm.domain.vo.MenuVO;
import com.crm.mapper.MenuMapper;
import com.crm.service.MenuService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping
@Api(tags = "菜单管理")
@RequiredArgsConstructor
public class MenuController {

    private final MenuService menuService;


    @GetMapping("/system/menu/list")
    @ApiOperation("菜单查询")
    public ResponseResult<List<MenuVO>> getMenuTree() {
        List<MenuVO> menuTree = menuService.getMenuTree();
        return ResponseResult.success(menuTree);
    }

}
